package com.study.lagou.edu.controller;

import com.study.lagou.edu.pojo.AuthCode;
import com.study.lagou.edu.service.IAuthCodeLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/log")
public class AuthCodeLogController {

    @Autowired
    private IAuthCodeLogService authCodeLogService;

    @GetMapping("/authcode/{pagesize}/{currentpage}")
    public Page<AuthCode> getAllAuthCode(@PathVariable("pagesize") int pageSize, @PathVariable("currentpage") int currentPage) {
        return authCodeLogService.findAll(pageSize, currentPage);
    }
}
